Trees in Programming

How to think in Graphs

Created: 2022-06-07
Tags: #fleeting


Abstract:


  1. The last nodes of the tree is called 'leaves'
  2. Process of navigating the tree is "traversal"
  3. A node with at least one child is called "internal node"
  4. Total number of children of a node is "degree of that node"
  5. The number of edges from node A to root node is the "depth of the node"
  6. The number of edges from root node to leaf is the "height of the node"

Red-Black Tree

  • The Red-Black tree is one such configuration of the binary search tree that makes the insertion and deletion process more efficient.

Binary Tree

  • The largest number is at the rightside, the smallest number is on the leftside
  • Just like in binary number system where there's only two digits, the binary tree also only have maximum two subtree/child that a parent can have.

Binary Search Tree

References

  1. https://www.freecodecamp.org/news/the-codeless-guide-to-tree-data-structures/
  2. https://www.youtube.com/watch?v=9oTV7fDEaCY Trees In Data Structure | Introduction To Trees | Data Structures & Algorithms Tutorial |Simplilearn